// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 通用下载请求 GET /api/common/download */
export async function commonFileDownloadUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.commonFileDownloadUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<any>('/api/common/download', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 本地资源通用下载 GET /api/common/download/resource */
export async function commonResourceDownloadUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.commonResourceDownloadUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<any>('/api/common/download/resource', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 拼接图片url GET /api/common/getUrl */
export async function commonGetPicUrlUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.commonGetPicUrlUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<string>('/api/common/getUrl', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 通用上传请求（单个） POST /api/common/upload */
export async function commonUploadFileUsingPOST(body: string, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/common/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 通用上传请求（多个） POST /api/common/uploads */
export async function commonUploadFilesUsingPOST(
  body: API.utilNameList,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/common/uploads', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
